home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / graphics / sviewiv / arexx-scripts / metaview.rx < prev    next >
Text File  |  1999-11-30  |  2KB  |  98 lines

  1. /*
  2.    $VER: MetaView.rx V9.00 (15.8.99)
  3.    © 1997-99 by Andreas R. Kleinert
  4.  
  5.    Load a vector graphics into MetaView, then
  6.    save it to ILBM and load it into SViewIV
  7.    written in 1997-99 by Andreas R. Kleinert
  8.  
  9. */
  10.  
  11. METAVIEW = 'hd5:MetaView/MetaView'    /* Please adjust the path                */
  12.                                       /* maybe also the "Bilder:" assign below */
  13.  
  14. OPTIONS RESULTS
  15. SIGNAL ON FAILURE
  16. SIGNAL ON SYNTAX
  17.  
  18. /*
  19. ** Looking for our start process
  20. */
  21.  
  22. SVPORT = 'SViewII.rx'
  23.  
  24. IF ~SHOW('P',SVPORT) THEN DO
  25.     say "Please start SViewIV before!"
  26.     EXIT
  27. end
  28.  
  29. /*
  30. ** Create a new Metaview process:
  31. ** first look for the already running processes;
  32. ** the new port will be the next one
  33. */
  34.  
  35. do NUMBER = 0 to 20
  36.     if (SHOW(PORTS,"METAVIEW." || NUMBER) = 0) then
  37.     leave
  38. end
  39.  
  40. /*
  41. ** Searching for MetaView: 1. our path above,
  42. **    2. path in env:MetaView.path
  43. ** or 3. you must have an assign "MetaView:"
  44. */
  45.  
  46. if (EXISTS(METAVIEW)=0) then do
  47.     if OPEN("MVVAR","env:MetaView.path","Read") then do
  48.         METAVIEW = READLN("MVVAR")
  49.     end
  50.     if (EXISTS(METAVIEW)=0) then do
  51.         METAVIEW = "MetaView:MetaView"
  52.     end
  53. end
  54.  
  55. /*
  56. ** Enable warnings for WaitForPort
  57. */
  58.  
  59. OPTIONS FAILAT 5
  60. ADDRESS COMMAND
  61.     "run " || METAVIEW || " NODISPLAY"
  62.     MVPORT = "METAVIEW." || NUMBER
  63.     "WaitForPort " || MVPORT
  64.  
  65. /*
  66. ** Ignore the other errors
  67. */
  68.  
  69. OPTIONS FAILAT 21
  70.  
  71. /*
  72. ** Do all needed things with MetaView (LOAD,SAVE,QUIT...)
  73. */
  74.  
  75. ADDRESS VALUE MVPORT
  76.     REQUESTFILE "Bilder:"
  77.     FILENAME = result
  78.     LOAD FILENAME
  79.     SAVE "t:mv_sv_import.ilbm" AS ILBM
  80.     QUIT
  81.  
  82. /*
  83. **  Import the temporary file in application
  84. */
  85.  
  86. ADDRESS VALUE SVPORT
  87.     'LOAD=t:mv_sv_import.ilbm'
  88.     EXIT
  89.  
  90. FAILURE:
  91.     ADDRESS COMMAND
  92.     REQUESTCHOICE "Error" """Can't find" METAVIEW "!""" "OK"
  93.     EXIT
  94.  
  95. SYNTAX:
  96.     say "Error on line" SIGL ":" ERRORTEXT(RC) "!"
  97.     EXIT
  98.